:root {
    /* Apple Design System Colors */
    --primary: #0A84FF;
    --secondary: #5E5CE6;
    --accent: #FF9F0A;
    --background: #000000;
    --elevated-background: rgba(28, 28, 30, 0.92);
    --card-background: rgba(44, 44, 46, 0.8);
    --border: rgba(84, 84, 88, 0.65);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --text-tertiary: rgba(235, 235, 245, 0.3);
    --error: #FF453A;
    --success: #32D74B;
    
    /* Shadows and Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --blur-background: saturate(180%) blur(20px);
    
    /* Animation */
    --transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    
    /* Typography */
    --system-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', system-ui, sans-serif;
    --radius-base: 10px;
    --radius-lg: 14px;
    --spacing-base: 16px;
}

body {
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text-primary);
    font-family: var(--system-font);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
    background: var(--elevated-background);
    backdrop-filter: var(--blur-background);
    -webkit-backdrop-filter: var(--blur-background);
}

.header {
    padding: var(--spacing-base) 0;
    background: var(--card-background);
    backdrop-filter: var(--blur-background);
    -webkit-backdrop-filter: var(--blur-background);
    border-bottom: 0.5px solid var(--border);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-base) * 1.25);
    padding: 0 var(--spacing-base);
}

.logo {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.022em;
}

.page-title {
    font-size: 34px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    text-align: center;
    letter-spacing: -0.03em;
}

.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: calc(var(--spacing-base) * 1.5) var(--spacing-base);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-base) * 1.5);
}

.query-section {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--border);
    backdrop-filter: var(--blur-background);
    -webkit-backdrop-filter: var(--blur-background);
    padding: calc(var(--spacing-base) * 1.5);
}

.form-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 calc(var(--spacing-base) * 1.25);
    letter-spacing: -0.022em;
    color: var(--text-primary);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-base) * 0.75);
    margin-bottom: var(--spacing-base);
}

.input-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: -0.022em;
}

.text-input {
    width: 100%;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-base);
    padding: 0 12px;
    color: var(--text-primary);
    font-family: var(--system-font);
    font-size: 15px;
    letter-spacing: -0.022em;
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
}

.text-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
}

.text-input::placeholder {
    color: var(--text-secondary);
}

.server-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: var(--spacing-base);
}

.server-button {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-base);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.022em;
    cursor: pointer;
    transition: var(--transition);
}

.server-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.server-button.active {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: calc(var(--spacing-base) * 1.25);
}

.primary-button {
    flex: 1;
    padding: 12px 24px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-base);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.022em;
    cursor: pointer;
    transition: var(--transition);
}

.primary-button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.primary-button:active {
    transform: translateY(0);
}

.secondary-button {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-base);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.022em;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.announcement {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    padding: calc(var(--spacing-base) * 0.75);
    color: var(--text-primary);
    font-size: 15px;
    letter-spacing: -0.022em;
    line-height: 1.4;
}

.announcement-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.announcement-content {
    font-size: 15px;
    line-height: 2;
}

.announcement-content br {
    display: none;
}

.announcement-content br + br {
    display: block;
    margin: 8px 0;
}

.result-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.result-popup.show {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.result-container {
    background: var(--elevated-background);
    border-radius: 14px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 0.1s;
    padding: 20px;
}

.result-popup.show .result-container {
    transform: scale(1);
    opacity: 1;
}

.result-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.022em;
}

.result-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.result-section:last-child {
    margin-bottom: 0;
}

.result-section h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
    letter-spacing: -0.022em;
}

.result-section p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    font-size: 15px;
    letter-spacing: -0.022em;
    line-height: 1.4;
}

.result-section .label {
    color: var(--text-secondary);
}

.result-section .value {
    color: var(--text-primary);
    font-weight: 500;
}

.popup-close {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.022em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    margin-top: 20px;
}

.popup-close:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.popup-close:active {
    transform: translateY(0);
    filter: brightness(0.9);
}

.error-message {
    color: var(--error);
    font-size: 15px;
    text-align: center;
    padding: 16px;
    letter-spacing: -0.022em;
    background: rgba(255, 69, 58, 0.1);
    border-radius: 12px;
    margin: 16px 0;
}

.snackbar {
    position: fixed;
    top: calc(var(--spacing-base) * 1.25);
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-base);
    font-size: 15px;
    letter-spacing: -0.022em;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
}

.snackbar.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.icon {
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.help-button {
    position: absolute;
    right: 8px;
    top: 42px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.help-button:hover {
    color: var(--primary);
}

.tutorial-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1000;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

.tutorial-dialog.show {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dialog-content {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: calc(var(--spacing-base) * 1.5);
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 0.1s;
}

.tutorial-dialog.show .dialog-content {
    transform: scale(1);
    opacity: 1;
}

.dialog-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 20px;
    transition: var(--transition);
}

.dialog-close:hover {
    color: var(--primary);
}

.tutorial-image {
    width: 100%;
    border-radius: var(--radius-base);
    margin-bottom: var(--spacing-base);
}

.dialog-content p {
    margin: 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    letter-spacing: -0.022em;
}

@media (max-width: 768px) {
    .main-content {
        padding: var(--spacing-base);
    }

    .query-section {
        padding: calc(var(--spacing-base) * 1.25);
    }

    .page-title {
        font-size: 28px;
    }

    .server-buttons {
        flex-direction: column;
    }

    .server-button {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .form-title {
        font-size: 18px;
    }
} 